package xhwl.insurance.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import java.util.ArrayList;

import xhwl.insurance.R;
import xhwl.insurance.http.bean.resp.HzOrderResp;

/**
 * Created by chengang on 2017/7/28
 */

public class PerformanceAdapter extends BaseAdapter {
    private Context mContext;
    private ArrayList<HzOrderResp> mlistVo;
    public PerformanceAdapter(Context mContext,ArrayList<HzOrderResp> mlistVo){
        this.mContext = mContext;
        this.mlistVo = mlistVo;
    }

    @Override
    public int getCount() {
        return mlistVo.size();
    }

    @Override
    public Object getItem(int position) {
        return mlistVo.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup viewGroup) {
          ViewHolder holder = null;
        if (convertView == null) {
            convertView = LayoutInflater.from(mContext).inflate(R.layout.performance_item, null);
            holder = new ViewHolder();
            holder.card_num = (TextView) convertView.findViewById(R.id.card_num);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }

        holder.card_num.setText(mlistVo.get(position).getSALE_NAME() + "(" + mlistVo.get(position).getNUM() + "张" + ") " );

        return convertView;
    }

    class ViewHolder {
        TextView card_num;

    }
}
